(function(){var t=window.BX,e=window.BXMobileApp;if(t&&t["Mobile"]&&t["Mobile"]["Grid"]&&t["Mobile"]["Grid"]["Form"])return;t.namespace("BX.Mobile.Grid.Form");var i={formId:{},gridId:{}},s=function(){var i=function(e,i,s){this.click=t.delegate(this.click,this);this.callback=t.delegate(this.callback,this);this.multiple=false;this.select=null;this.eventNode=null;this.container=null;this.titles=[];this.values=[];this.defaultTitles=[];this.init(e,i,s)};i.prototype={init:function(e,i,s){if(t(e)&&t(i)&&t(s)){this.select=e;this.eventNode=i;this.container=s;if(!this.select.hasAttribute("bx-bound")){this.select.setAttribute("bx-bound","Y");t.addCustomEvent(e,"onChange",t.delegate((function(){this.multiple=this.select.hasAttribute("multiple");this.initValues()}),this));t.bind(this.eventNode,"click",this.click)}this.multiple=e.hasAttribute("multiple");this.initValues()}},initValues:function(){this.titles=[];this.values=[];this.defaultTitles=[];for(var t=0;t<this.select.options.length;t++){this.titles.push(this.select.options[t].innerHTML);this.values.push(this.select.options[t].value);if(this.select.options[t].hasAttribute("selected"))this.defaultTitles.push(this.select.options[t].innerHTML)}},click:function(e){this.show();return t.PreventDefault(e)},show:function(){if(this.titles.length>0){e.UI.SelectPicker.show({callback:this.callback,values:this.titles,multiselect:this.multiple,default_value:this.defaultTitles})}},callback:function(e){this.defaultTitles=[];if(e&&e.values&&e.values.length>0){var i=[],s,n;for(s=0;s<this.titles.length;s++){for(n=0;n<e.values.length;n++){if(this.titles[s]==e.values[n]){i.push(this.values[s]);this.defaultTitles.push(this.titles[s]);break}}}var a="";for(s=0;s<this.select.options.length;s++){this.select.options[s].removeAttribute("selected");if(t.util.in_array(this.select.options[s].value,i)){this.select.options[s].setAttribute("selected","selected");if(this.multiple){a+='<a href="javascript:void();">'+this.select.options[s].innerHTML+"</a>"}else{a=this.select.options[s].innerHTML}}}if(a===""&&!this.multiple)a='<span style="color:grey">'+t.message("interface_form_select")+"</span>";this.container.innerHTML=a;t.onCustomEvent(this,"onChange",[this,this.select])}}};return i}(),n=function(){var i=function(e,i,s,n){this.type=i;this.node=e;this.container=s;this.click=t.delegate(this.click,this);this.callback=t.delegate(this.callback,this);t.bind(this.container,"click",this.click);t.bind(this.container.parentNode,"click",this.click);this.type="datetime";this.format={inner:{datetime:"dd.MM.yyyy H:mm",time:"H:mm",date:"dd.MM.yyyy"},bitrix:{datetime:null,time:null,date:null},visible:{datetime:null,time:null,date:null}};this.init(n)};i.prototype={click:function(e){t.eventCancelBubble(e);this.show();return t.PreventDefault(e)},show:function(){var t={type:this.type,start_date:this.getStrDate(this.node.value),format:this.format.inner[this.type],callback:this.callback};if(t["start_date"]=="")delete t["start_date"];e.UI.DatePicker.setParams(t);e.UI.DatePicker.show()},callback:function(e){var i=this.makeDate(e);this.node.value=t.date.format(this.format.bitrix[this.type],i);var s=t.date.format(t.clone(this.format.visible[this.type]),i);if(!t.type.isNotEmptyString(s))s=this.container.getAttribute("placeholder")||" ";this.container.innerHTML=s;this.delButton.style.display="inline-block";t.onCustomEvent(this,"onChange",[this,this.node])},makeDate:function(e){var i=new Date;if(t.type.isNotEmptyString(e)){var s=new RegExp("(\\d{2}).(\\d{2}).(\\d{4})"),n=new RegExp("(\\d{1,2}):(\\d{1,2})"),a;if(s.test(e)&&(a=s.exec(e))&&a){i.setDate(1);i.setFullYear(a[3]);i.setMonth(a[2]-1);i.setDate(a[1])}if(n.test(e)&&(a=n.exec(e))&&a){i.setHours(a[1]);i.setMinutes(a[2]);i.setSeconds(0)}}return i},getStrDate:function(e){var i=t.parseDate(e),s="";if(i!==null){if(this.type=="date"||this.type=="datetime"){s=t.util.str_pad_left(i.getDate().toString(),2,"0")+"."+t.util.str_pad_left((i.getMonth()+1).toString(),2,"0")+"."+i.getFullYear().toString()}if(this.type=="datetime")s+=" ";if(this.type=="time"||this.type=="datetime"){s+=t.util.str_pad_left(i.getHours().toString(),2,"0")+":"+i.getMinutes().toString()}}return s},init:function(e){var i=t.date.convertBitrixFormat(t.message("FORMAT_DATETIME")),s=t.date.convertBitrixFormat(t.message("FORMAT_DATE")),n;if(i.substr(0,s.length)==s)n=t.util.trim(i.substr(s.length));else n=t.date.convertBitrixFormat(i.indexOf("T")>=0?"H:MI:SS T":"HH:MI:SS");this.format.bitrix.datetime=i;this.format.bitrix.date=s;this.format.bitrix.time=n;e=e||{};this.format.visible.datetime=e["datetime"]||i.replace(":s","");this.format.visible.date=e["date"]||s;this.format.visible.time=e["time"]||n.replace(":s","");this.format.visible.datetime=[["today","today, "+this.format.visible.time],["tommorow","tommorow, "+this.format.visible.time],["yesterday","yesterday, "+this.format.visible.time],["",this.format.visible.datetime]];this.format.visible.date=[["today","today"],["tommorow","tommorow"],["yesterday","yesterday"],["",this.format.visible.date]];this.delButton=t(this.node.id+"_del");t.bind(this.delButton,"click",t.proxy(this.drop,this))},drop:function(e){if(e){t.eventCancelBubble(e);t.PreventDefault(e)}this.node.value="";this.container.innerHTML=this.container.getAttribute("placeholder");this.delButton.style.display="none";t.onCustomEvent(this,"onChange",[this,this.node]);return false}};return i}(),a=function(){var i=function(e,i,s){this.click=t.delegate(this.click,this);this.callback=t.delegate(this.callback,this);this.drop=t.delegate(this.drop,this);this.select=t(e);this.eventNode=t(i);this.container=t(s);t.bind(this.eventNode,"click",this.click);this.multiple=e.hasAttribute("multiple");this.showDrop=!(e.hasAttribute("bx-can-drop")&&e.getAttribute("bx-can-drop").toString()=="false");this.urls={list:t.message("SITE_DIR")+"mobile/index.php?mobile_action=get_user_list",profile:t.message("interface_form_user_url")};this.actualizeNodes();this.expand=t("expand_"+this.select.getAttribute("id"));this.visCount=t("count_"+this.select.getAttribute("id"));if(!this.container.parentNode.hasAttribute("bx-fastclick-bound")){this.container.parentNode.setAttribute("bx-fastclick-bound","Y");FastClick.attach(this.container.parentNode.parentNode)}};i.prototype={click:function(e){this.show();return t.PreventDefault(e)},show:function(){new e.UI.Table({url:this.urls.list,table_settings:{callback:this.callback,markmode:true,multiple:this.multiple,return_full_mode:true,skipSpecialChars:true,modal:true,alphabet_index:true,outsection:false,okname:t.message("interface_form_select"),cancelname:t.message("interface_form_cancel")}},"users").show()},drop:function(){var e=t.proxy_context,i=e.id.replace(this.select.id+"_del_","");for(var s=0;s<this.select.options.length;s++){if(this.select.options[s].value+""==i+""){t.remove(t.findParent(e,{tagName:"DIV",className:"mobile-grid-field-select-user-item"}));t.remove(this.select.options[s])}}if(this.select.options.length<=0&&!this.multiple)this.eventNode.innerHTML=t.message("interface_form_select");if(this.expand)this.expand.value=this.select.options.length;if(this.visCount)this.visCount.innerHTML=this.select.options.length-3;t.onCustomEvent(this,"onChange",[this,this.select])},actualizeNodes:function(){if(this.expand)this.expand.value=this.select.options.length;if(this.visCount)this.visCount.innerHTML=this.select.options.length-3;for(var e=0;e<this.select.options.length;e++){if(t(this.select.id+"_del_"+this.select.options[e].value)){t.bind(t(this.select.id+"_del_"+this.select.options[e].value),"click",this.drop)}}},buildNodes:function(e,i){if(!t.Type.isStringFilled(i)){i="users"}var s="",n="",a,o=0,l,r=[];for(a=0;a<this.select.options.length;a++){r.push(this.select.options[a].value.toString());o++}for(a=0;a<Math.min(this.multiple?e.length:1,e.length);a++){l=e[a];if(t.util.in_array(l["ID"],r))continue;s+='<option value="'+l["ID"]+'" selected>'+l["NAME"]+"</option>";n+=['<div class="mobile-grid-field-select-user-item-outer">','<div class="mobile-grid-field-select-user-item">',this.showDrop?'<del id="'+this.select.id+"_del_"+l["ID"]+'"></del>':"",'<div class="avatar"',l["IMAGE"]?" style=\"background-image:url('"+l["IMAGE"]+"')\"":"","></div>",i==="group"?'<a class="mobile-grid-field-select-user-item-link" href="'+this.urls.profile.replace("#ID#",l["ID"])+'">'+l["NAME"]+"</a>":"<span onclick=\"BXMobileApp.PageManager.loadPageBlank({url: '"+this.urls.profile.replace("#ID#",l["ID"])+"',bx24ModernStyle : true});\">"+l["NAME"]+"</span>","</div>","</div>"].join("").replace(" style=\"background-image:url('')\"","");o++}if(this.expand)this.expand.value=o;if(this.visCount)this.visCount.innerHTML=o-3;if(n!=""){this.select.innerHTML=(this.multiple?this.select.innerHTML:"")+s;this.container.innerHTML=(this.multiple?this.container.innerHTML:"")+n;if(this.select.innerHTML!=""&&!this.multiple)this.eventNode.innerHTML=t.message("interface_form_change");t.onCustomEvent(this,"onChange",[this,this.select]);var d=0,h=t.proxy((function(){if(d<100){if(this.container.childNodes.length>0)this.actualizeNodes();else if(d++)setTimeout(h,50)}}),this);setTimeout(h,50)}},callback:function(t){if(t&&t.a_users)this.buildNodes(t.a_users,"user")}};return i}(),o=function(){var e=function(i,s,n){e.superclass.constructor.apply(this,arguments);this.urls={list:t.message("SITE_DIR")+"mobile/index.php?mobile_action=get_group_list",profile:t.message("interface_form_group_url")}};t.extend(e,a);e.prototype.callback=function(t){if(t&&t.b_groups)this.buildNodes(t.b_groups,"group")};return e}(),l=function(){var e=function(e,i){this.node=e;this.container=i;this.click=t.delegate(this.click,this);this.callback=t.delegate(this.callback,this);t.bind(this.container,"click",this.click)};e.prototype={click:function(e){this.show();return t.PreventDefault(e)},show:function(){window.app.exec("showPostForm",{attachButton:{items:[]},attachFileSettings:{},attachedFiles:[],extraData:{},mentionButton:{},smileButton:{},message:{text:t.util.htmlspecialcharsback(this.node.value)},okButton:{callback:this.callback,name:t.message("interface_form_save")},cancelButton:{callback:function(){},name:t.message("interface_form_cancel")}})},callback:function(e){e.text=t.util.htmlspecialchars(e.text)||"";this.node.value=e.text;if(e.text=="")this.container.innerHTML='<span class="placeholder">'+this.node.getAttribute("placeholder")+"</span>";else this.container.innerHTML=e.text;t.onCustomEvent(this,"onChange",[this,this.node])}};return e}(),r=function(){var e=function(e){this.node=e;var i=t.findParent(this.node,{tagName:"LABEL"});if(i&&i.parentNode&&!i.parentNode.hasAttribute("bx-fastclick-bound")){i.parentNode.setAttribute("bx-fastclick-bound","Y");FastClick.attach(i.parentNode)}t.bind(this.node,"change",t.delegate(this.change,this))};e.prototype={change:function(){t.onCustomEvent(this,"onChange",[this,this.node])}};return e}(),d=function(){var e=function(e){this.dialogName="FileDialog";this.node=e;this.id=this.node.getAttribute("id");this.controlName=this.node.getAttribute("data-bx-name");this.container=t("file-placeholder-"+this.id);this.uploadParams={uploadMethod:t.type.isNotEmptyString(this.node.getAttribute("data-bx-url"))?"immediate":"deferred",uploadFileUrl:this.node.getAttribute("data-bx-url"),allowUpload:this.node.getAttribute("data-bx-type")=="image"?"I":"A",allowUploadExt:this.node.getAttribute("data-bx-extension"),maxCount:this.node.getAttribute("data-bx-max")};this.button=t("file-eventnode-"+this.id);if(this.button)t.bind(this.button,"click",t.proxy(this.click,this));this.agent=t.Uploader.getInstance({id:this.id,streams:1,allowUpload:this.uploadParams["allowUpload"],allowUploadExt:this.uploadParams["allowUploadExt"],uploadFormData:"N",uploadMethod:this.uploadParams["uploadMethod"],uploadFileUrl:this.uploadParams["uploadFileUrl"],showImage:true,sortItems:false,input:t(this.id+"_file"),dropZone:null,placeHolder:this.container,queueFields:{thumb:{tagName:"DIV",className:"mobile-grid-field-file-item mobile-grid-field-file-file"}},fields:{thumb:{tagName:"",template:t.message("FILE_NODE")},preview:{params:{width:212,height:119}}}});this.init();return this};e.prototype={click:function(e){if(t.hasClass(this.button,"disabled"))t.DoNothing();else if(!window["BXMobileAppContext"])return true;else this.show();return t.PreventDefault(e)},show:function(){var e=[{title:t.message("MPF_PHOTO_CAMERA"),callback:t.delegate((function(){window.app.takePhoto({quality:80,source:1,correctOrientation:true,targetWidth:1024,targetHeight:1024,destinationType:window["Camera"]["DestinationType"]["DATA_URL"],callback:this.handleAppFile})}),this)},{title:t.message("MPF_PHOTO_GALLERY"),callback:t.delegate((function(){window.app.takePhoto({quality:80,targetWidth:1024,targetHeight:1024,destinationType:window["Camera"]["DestinationType"]["DATA_URL"],callback:this.handleAppFile})}),this)}];new window.BXMobileApp.UI.ActionSheet({buttons:e},"textPanelSheet").show()},handleAppFile:function(e){var i=t.UploaderUtils.dataURLToBlob("data:image/jpg;base64,"+e);i.name="mobile_"+t.date.format("Ymd_His")+".jpg";this.agent&&this.agent.onChange([i])},init:function(){this.handleAppFile=t.delegate(this.handleAppFile,this);this._onFileIsBound=t.delegate(this.onFileIsBound,this);this._onFileIsAppended=t.delegate(this.onFileIsAppended,this);this._onUploadStart=t.delegate(this.onUploadStart,this);this._onUploadProgress=t.delegate(this.onUploadProgress,this);this._onUploadDone=t.delegate(this.onUploadDone,this);this._onUploadError=t.delegate(this.onUploadError,this);t.addCustomEvent(this.agent,"onFileIsCreated",t.delegate(this.onFileIsCreated,this));var e=t.findChildren(this.container,{tagName:"DIV"},false);if(e.length>0){var i=[],s=[],n;for(var a=0;a<e.length;a++){n=t.findChild(e[a],{className:"mobile-grid-field-file-name"},true);if(t(n)){i.push({name:n.innerHTML,id:e[a].getAttribute("id").replace("file-","")});s.push(e[a])}}this.agent.onAttach(i,s)}if(this.uploadParams["maxCount"]>0){t.addCustomEvent(this.agent,"onAttachFiles",t.delegate(this.onAttachFiles,this));t.addCustomEvent(this.agent,"onQueueIsChanged",t.delegate(this.onQueueIsChanged,this));this.onQueueIsChanged()}},onQueueIsChanged:function(){if(1<this.uploadParams["maxCount"]&&this.uploadParams["maxCount"]<=this.agent.getItems().length||1==this.uploadParams["maxCount"]&&this.uploadParams["maxCount"]<this.agent.getItems().length){t.addClass(this.button,"disabled")}else{t.removeClass(this.button,"disabled")}},onAttachFiles:function(e){var i=false;if(e){if(this.uploadParams["maxCount"]==1&&e.length>0){while(this.agent.getItems().length>0)this.deleteFile(this.agent.getItems().getFirst(),true);while(e.length>1)e.pop()}var s=this.uploadParams["maxCount"]-this.agent.getItems().length;s=s>0?s:0;while(e.length>s){e.pop();i=true}}if(i){t.addClass(this.button,"disabled")}return e},onFileIsCreated:function(e,i){if(i["file"]&&i["file"]["size"])i.size=t.UploaderUtils.getFormattedSize(i.file.size,2);t.addCustomEvent(i,"onFileIsBound",this._onFileIsBound);t.addCustomEvent(i,"onFileIsAppended",this._onFileIsAppended);t.addCustomEvent(i,"onUploadStart",this._onUploadStart);t.addCustomEvent(i,"onUploadProgress",this._onUploadProgress);t.addCustomEvent(i,"onUploadDone",this._onUploadDone);t.addCustomEvent(i,"onUploadError",this._onUploadError)},onFileIsBound:function(t,e){this.bindFile(e)},onFileIsAppended:function(e,i){this.bindFile(i);if(this.agent.params["uploadMethod"]!="immediate"){var s=this.agent.getItem(i.id);s=s?s.node:s;t.onCustomEvent(this,"onChange",[this,this.node,{action:"add",file:i.file,node:s,item:i}])}},onUploadStart:function(e){var i=this.agent.getItem(e.id);if(i&&(i=i.node)&&i)t.addClass(i,"mobile-grid-field-file-wait")},onUploadProgress:function(t,e){},onUploadDone:function(e,i){var s=this.agent.getItem(e.id);if(!s||!((s=s.node)&&s))return;t.removeClass(s,"mobile-grid-field-file-wait");var n=i["file"];e.file={id:n["id"],name:n["name"]};var a=t.findChildByClassName(s,"mobile-grid-field-file-name",true);if(a)a.innerHTML=n["name"];var o=t.create("INPUT",{attrs:{type:"hidden",name:this.controlName,value:n["id"]}});s.appendChild(o);t.onCustomEvent(this,"onChange",[this,this.node,{action:"delete",file:e.file,node:s,item:e}]);this.bindFile(e)},onUploadError:function(e){var i=this.agent.getItem(e.id);if(!i||!((i=i.node)&&i))return;t.removeClass(i,"mobile-grid-field-file-wait");t.addClass(i,"mobile-grid-field-file-error")},bindFile:function(e){var i=this.agent.getItem(e.id);if(!i||!((i=i.node)&&i))return;if(e.dialogName=="BX.UploaderImage"){if(!t.hasClass(i,"mobile-grid-field-file-image"))t.addClass(i,"mobile-grid-field-file-image");t.removeClass(i,"mobile-grid-field-file-file")}var s=t.findChild(i,{tagName:"DEL"},true);if(s&&!s.hasAttribute("bx-bound")){s.setAttribute("bx-bound","Y");t.bind(s,"click",t.delegate((function(){this.deleteFile(e)}),this))}},deleteFile:function(e){e.deleteFile();t.onCustomEvent(this,"onChange",[this,this.node,{action:"delete",file:e.file,node:null,item:e}])}};return e}();window.app.exec("enableCaptureKeyboard",true);t.Mobile.Grid.Form=function(s){var n=s&&s.skipLoadingScreenHiding;if(!n){e.UI.Page.LoadingScreen.hide()}this.elements=[];if(typeof s==="object"){this.gridId=s["gridId"]||"";this.formId=s["formId"]||"";if(this.gridId!="")i["gridId"][this.gridId]=this;if(this.formId!="")i["formId"][this.formId]=this;this.formats=s["formats"]||null;var a=s["customElements"]||[],o,l,r=t.proxy((function(e,i){var s=[this,i,e];for(var n=2;n<arguments.length;n++){s.push(arguments[n])}t.onCustomEvent(this,"onChange",s);window.BXMobileApp.Events.postToComponent("onMobileGridFormDataChange",this.getParamsForMobilePostEvent(i,e),"tasks.view")}),this);this.apply=t.delegate(this.apply,this);this.restrictedMode=s["restrictedMode"];while((o=a.pop())&&o){if((l=this.bindElement(t(o)))&&l){this.elements.push(l);if(s["restrictedMode"])t.addCustomEvent(l,"onChange",this.apply);t.addCustomEvent(l,"onChange",r)}}t.addCustomEvent("BX.Mobile.Field:onChangeUserField",this.apply);if(t(this.formId)&&t("submit_"+this.formId)){t.bind(t("submit_"+this.formId),"click",t.delegate(this.click,this));t.bind(t("cancel_"+this.formId),"click",t.delegate(this.cancel,this))}else if(s["buttons"]=="app"){window.BXMobileApp.UI.Page.TopBar.updateButtons({cancel:{type:"back_text",callback:t.delegate(this.cancel,this),name:t.message("interface_form_cancel"),bar_type:"navbar",position:"left"},ok:{type:"back_text",callback:t.delegate(this.click,this),name:t.message("interface_form_save"),bar_type:"navbar",position:"right"}})}if(t("buttons_"+this.formId)){var d=this.formId;t.addCustomEvent("onKeyboardWillShow",(function(){t.addClass(t("buttons_"+d),"mobile-grid-button-panel-regular")}));t.addCustomEvent("onKeyboardDidHide",(function(){t.removeClass(t("buttons_"+d),"mobile-grid-button-panel-regular")}))}t.onCustomEvent(window,"onInitialized",[this.formId,this.gridId,this])}};t.Mobile.Grid.Form.prototype={bindElement:function(e){var i=null;if(t(e)){var h=e.tagName.toLowerCase(),u=e.hasAttribute("data-bx-type")?e.getAttribute("data-bx-type").toLowerCase():"";if(h=="select"&&e.getAttribute("data-bx-type")=="select-user"){i=new a(e,t(e.id+"_select"),t(e.id+"_target"))}else if(h=="select"&&e.getAttribute("data-bx-type")=="select-group"){i=new o(e,t(e.id+"_select"),t(e.id+"_target"))}else if(h=="select"){i=new s(e,t(e.id+"_select"),e.hasAttribute("multiple")?t(e.id+"_target"):t(e.id+"_select"))}else if(e.getAttribute("type")=="text"){t.bind(e,"keyup",(function(i){i=i||window.event;if(i&&i.keyCode==13){var s,n=false;t.eventCancelBubble(i);for(s=0;s<e.form.elements.length;s++){if(n){if(e.form.elements[s].tagName.toLowerCase()=="textarea"||e.form.elements[s].tagName.toLowerCase()=="input"&&e.form.elements[s].getAttribute("type").toLowerCase()=="text"){t.focus(e.form.elements[s])}break}n=e.form.elements[s]==e}}}))}else if(h=="textarea"){}else if(e.getAttribute("type")=="checkbox"||e.getAttribute("type")=="radio"){i=new r(e)}else if(u=="text"||u=="textarea"){i=new l(e,t(e.id+"_target"))}else if(u=="date"||u=="datetime"||u=="time"){i=new n(e,u,t(e.id+"_container"),this.format)}else if(u=="disk_file"){i=t.Disk.UFMobile.getByName(e.value)}else if(u=="diskview_file"){i=t.Disk.UFMobile.getByName(e.value)}else if(u=="file"||u=="image"){i=new d(e)}}return i},cancel:function(e){if(e)t.PreventDefault(e);t.onCustomEvent(this,"onCancel",[this,t(this.formId)]);return false},click:function(e){if(e)t.PreventDefault(e);this.save();return false},apply:function(e,i,s){var n={submit:true};t.onCustomEvent(this,"onSubmitForm",[this,t(this.formId),i,n]);window.BXMobileApp.onCustomEvent("onSubmitForm",[this.gridId,this.formId,i?i.id:null],true);if(n.submit!==false){if(e.dialogName==="FileDialog"&&s&&s["action"]==="add"){t.addCustomEvent(this,"onBeforeSubmitAjax",(function(t,i){i["data"]=i["data"]||{};i["data"][e.controlName]=s.file}))}this.submit(true)}},save:function(){var e={submit:true};t.onCustomEvent(this,"onSubmitForm",[this,t(this.formId),null,e]);window.BXMobileApp.onCustomEvent("onSubmitForm",[this.gridId,this.formId,null],true);if(e.submit!==false)this.submit(false)},submit:function(i){if(!t(this.formId))return;var s={restricted:"Y",method:t(this.formId).getAttribute("method"),onsuccess:t.proxy((function(){t.onCustomEvent(this,"onSubmitAjaxSuccess",[this,arguments[0]])}),this),onfailure:t.proxy((function(){t.onCustomEvent(this,"onSubmitAjaxFailure",[this,arguments[0]])}),this),onprogress:t.proxy((function(){t.onCustomEvent(this,"onSubmitAjaxProgress",[this,arguments])}),this)};if(i){t.onCustomEvent(this,"onBeforeSubmitAjax",[this,s])}else{s["restricted"]="N";s["onsuccess"]=t.proxy((function(){e.UI.Page.LoadingScreen.hide();t.onCustomEvent(this,"onSubmitFormSuccess",[this,arguments[0]])}),this);s["onfailure"]=t.proxy((function(){e.UI.Page.LoadingScreen.hide();t.onCustomEvent(this,"onSubmitFormFailure",[this,arguments[0]])}),this);s["onprogress"]=t.proxy((function(){t.onCustomEvent(this,"onSubmitFormProgress",[this,arguments])}),this);t.onCustomEvent(this,"onBeforeSubmitForm",[this,s]);e.UI.Page.LoadingScreen.show()}var n=t(this.formId).elements["save"];if(!t(n)){n=t.create("INPUT",{attrs:{type:"hidden",name:"save"}});t(this.formId).appendChild(n)}n.value="Y";t.ajax.submitAjax(t(this.formId),s)},getParamsForMobilePostEvent:function(e,i){var s={formId:this.formId,gridId:this.gridId,nodeId:e.id,nodeName:e.name,nodeValue:e.value};if(e.name==="data[DEADLINE]"){s.dateValue=t.parseDate(e.value,false)}if(e.name==="data[SE_RESPONSIBLE][0][ID]"){var n=i.container.getElementsByClassName("avatar")[0];s.responsibleIcon=n.style.backgroundImage}return s}};t.Mobile.Grid.Form.getByFormId=function(t){return i["formId"][t]};t.Mobile.Grid.Form.getByGridId=function(t){return i["gridId"][t]}})();
//# sourceMappingURL=script.map.js